import { getAction, deleteAction, putAction, postAction, httpAction, postFormData } from '@/api/manage'
const gateway = '/api/gateway/jic-usercenter-market-api-center'
const baseUrl = window._CONFIG['domianURL'] || '/jeecg-boot'

// 微商城会员中心-任务中心
const task = '/api/gateway/jic-usercenter-market-api-center/admin/task/api'
export const taskList = (params) => postAction(task + `/query/task/list`, params) // 查询任务模板列表
export const taskDetail = (params) => postAction(task + `/query/task/detail`, params) // 查询任务模板详情
export const operateTask = (params) => postAction(task + `/operate/task`, params) // 操作任务状态
export const addTask = (params) => postAction(task + `/add/task`, params) // 添加任务模板
export const updateTaskDetail = (params) => postAction(task + `/update/task/detail`, params) // 编辑任务详情
export const queryOperateTask = (params) => postAction(task + `/query/task/operator`, params) // 查询操作人列表
export const queryTaskDetails = (params) => postAction(task + `/query/task/template/details`, params) // 查询任务明细
export const batchUpdateTask = (params) => postAction(task + '/batch/update/task', params) // 批量修改日期

// 查询人群包列表
export const peoplesPage = (params) => postAction('/api/gateway/basemgt-peoples/peoples/peoplesPage', params) // 分页获取人群包列表
export const storesPag = (params) => postAction('/api/gateway/jic-backend-activity/store/package/page', params) // 门店包列表

// 微商城会员中心-会员品牌卡背景配置
const member = '/api/gateway/jic-usercenter-market-api-center/member/resource/api/admin'
export const queryCardBg = params => postAction(member + '/query/member/background', params) // 查询会员卡配置
export const saveCardBg = params => postAction(member + '/saveOrUpdate/member/background', params) // 保存或更新会员卡配置
export const publishCardBg = params => postAction(member + '/publish/member/background', params) // 发布配置

// 微商城会员中心-资源位
const posManager = '/api/gateway/jic-usercenter-market-api-center/admin/source/posManager'
export const posManagerCreateOrUpdate = params => postAction(`${posManager}/createOrUpdate`, params) // 创建资源位管理
export const posManagerBatchUpdate = params => postAction(`${posManager}/batchUpdate`, params) // 批量创建资源位管理
export const posManagerList = params => postAction(`${posManager}/list`, params) // 资源位管理列表

const posTemplate = '/api/gateway/jic-usercenter-market-api-center/admin/source/posTemplate'
export const posTemplateCreate = params => postAction(`${posTemplate}/create`, params) // 创建资源
export const posTemplateList = params => postAction(`${posTemplate}/list`, params) // 资源列表
export const posTemplateUpdate = params => postAction(`${posTemplate}/update`, params) // 修改资源
export const posTemplateUpOrDown = params => postAction(`${posTemplate}/upOrDown`, params) // 上下架
export const posTemplateInfo = id => getAction(`${posTemplate}/info/${id}`) // 资源详情